﻿<Window x:Class="BEControlCenter.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" 
        SnapsToDevicePixels="True" 
        Height="750" 
        Width="925" 
        WindowState="Maximized" 
        WindowStyle="None"
        Background="Black">
    <Window.Resources>
        <ResourceDictionary Source="BEControlCenterBasicStyles.xaml" />
    </Window.Resources>
    <Grid Margin="5">
        <Grid.Background>
            <LinearGradientBrush StartPoint="0,0" EndPoint="1,0">
                <GradientStop Color="DarkGray" Offset="0" />
                <GradientStop Color="LightGray" Offset="1" />
            </LinearGradientBrush>
        </Grid.Background>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
        <Canvas Grid.Column="0" HorizontalAlignment="Left">
            <Expander Name="SettingsExpander" Style="{StaticResource ResourceKey=BEExpander}" ExpandDirection="Right" IsExpanded="True">
                <Expander.Header>
                    <TextBlock Margin="5" FontWeight="Bold">
                        <TextBlock.Style>
                            <Style TargetType="TextBlock">
                                <Setter Property="Text" Value="Show settings"/>
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding ElementName=SettingsExpander, Path=IsExpanded}" Value="True">
                                        <Setter Property="Text" Value="Hide settings"/>
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </TextBlock.Style>
                    </TextBlock>
                </Expander.Header>
                <Grid Width="200" Margin="20,5">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="*"/>
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="30"/>
                        <RowDefinition Height="10"/>
                        <RowDefinition Height="30"/>
                    </Grid.RowDefinitions>
                    <TextBlock Grid.Column="0" Grid.Row="0" Text="Controller: "/>
                    <ComboBox Grid.Column="1" Grid.Row="0" ItemsSource="{Binding Path=Controllers}"
                              SelectedItem="{Binding Path=SelectedController}">
                        <ComboBox.ItemTemplate>
                            <DataTemplate>
                                <TextBlock Text="{Binding Path=Metadata.Name}" />
                            </DataTemplate>
                        </ComboBox.ItemTemplate>
                    </ComboBox>
                    <TextBlock Grid.Column="0" Grid.Row="2" Text="Device: "/>
                    <ComboBox Grid.Column="1" Grid.Row="2" ItemsSource="{Binding Path=Devices}"
                              SelectedItem="{Binding Path=SelectedDevice}">
                        <ComboBox.ItemTemplate>
                            <DataTemplate>
                                <TextBlock Text="{Binding Path=Metadata.Name}" />
                            </DataTemplate>
                        </ComboBox.ItemTemplate>
                    </ComboBox>
                </Grid>
            </Expander>
        </Canvas>
        <Grid Grid.Column="1">
            <Grid.RowDefinitions>
                <RowDefinition Height="35" />
                <RowDefinition Height="*" />
                <RowDefinition Height="30" />
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="2*" />
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>
            <ContentControl Grid.Row="1" Grid.Column="0" Content="{Binding Path=DeviceOutput}" Width="400" Height="300"/>
            <StackPanel Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" Orientation="Horizontal" HorizontalAlignment="Center">
                <Button Content="Init" Command="{Binding Path=InitCommand}" MinWidth="150" Margin="5,0"/>
                <Button Content="Shutdown" Command="{Binding Path=ShutdownCommand}" MinWidth="150" Margin="5,0"/>
            </StackPanel>
            <ContentControl Grid.Row="1" Grid.Column="1" Content="{Binding Path=ControllerOutput}"  Width="240" Height="180"/>
        </Grid>
    </Grid>
</Window>
